#include "logic/Quad.h"
#include "core/draw/Device.h"
#include "core/evnt/EventControl.h"

class Application
{
   public:
      Application()
	 : dev(false)
      {
      }
      
      void init()
      {
	 dev.init();
	 dev.createWindow(800, 600, false);
	 dev.initGL();
      }

      void draw()
      {
	 dev.beginScene();
	 //dev.getFont().
	 dev.endScene();
      }
      
      void run() 
      {
	 core::evnt::EventControl& evnt = core::evnt::EventControl::instance();
	 const core::evnt::Keyboard& keyb = evnt.getKeyboard();
	 bool shallQuit = false;

	 while (!shallQuit)
	 {
	    evnt.processEvent();
	    if (keyb.isKeyPressed(SDLK_ESCAPE))
	    {
	       shallQuit = true;
	    }

	    draw();
	 }
      }
      
      void done() {}

   private:
      core::draw::Device dev;
} app;


int main()
{
   app.init();
   app.run();
   app.done();
}
